package com.wlz.config;

import com.wlz.bean.Fox;
import com.wlz.bean.MyImportBeanDefinitionRegistrar;
import com.wlz.bean.MyImportSelector;
import com.wlz.bean.User;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

/**
 * @author wlz
 *
 */
@Configuration
@Import({MyImportBeanDefinitionRegistrar.class, MyImportSelector.class})
@ComponentScan("com.wlz")
public class AppConfig {

	@Bean
	public Fox fox(){
		// 多例   ---》 单例   beanFactory.getBean("fox")
		return new Fox();
	}

	@Bean
	public User user2(){
		return new User(fox());
	}

	@Bean
	public User user3(){
		return new User(fox());
	}

}
